<{capture name="header"}>
<link href="../apps/ome/statics/ome.css" rel="stylesheet" type="text/css">
<{/capture}>

  <div class="tableform">
    <h3>发货绩效</h3>
  <div class="division">
      <div class="gridlist" style="padding:10px;">
      <form method='post' id ='serachForm' action="index.php?app=omekpi&ctl=admin_deliverier&act=search">
        时间 <{input name="begin_date" id="begin_date" value="{$begin_date}" type="date" }> 至 <{input type="date" value="{$end_date}"  id="end_date"  name="end_date"}>
        <select name="select" id="select">
          <option value='NO'>员工编号</option>
          <option value='NA'>员工姓名</option>
        </select>
         <{input name="have" type="text" value=''}> <{button label="搜索" type='submit'}> &nbsp;&nbsp; &nbsp;
       </form>
       <form method='post' id ='serachForm' action="index.php?app=omekpi&ctl=admin_deliverier&act=export" class="tableform" target='download' enctype="multipart/form-data">
        <{button class="btn btn-primary" label="导出" type='submit'}>
        <textarea name="csv_data" style="display:none;" ><{$csv_data}></textarea>
      </form>
   </div>
    
<form method="post" id="fm1" action="index.php?app=omekpi&ctl=admin_deliverier&act=doadd">
      <table class="gridlist" id="purchase_table"  style="margin:4px 0; width:780px;">
        <thead>
          <tr>
            <th>员工编号</th>
            <th>员工姓名</th>
            <th>需发货共计</th>
            <th>已发货共计</th>
            <th>我的发货数量</th>
            <th>日期</th>
          </tr>
        </thead>
        <tbody id="dNode">
         <{foreach from=$deliveryList item=item key=key}>
          <tr id="<{$item.employee_id}>">
            <td style="display:none;"><{$item.employee_id}></td>
            <td><{$item.employee_op_no}></td>
            <td><{$item.employee_name}></td>
            <td><strong><a key='delivery_numbers' href="javascript:void(0);"><{$item.delivery_numbers}></a></strong></td>
            <td><strong><a key='deliveried_numbers' href="javascript:void(0);"><{$item.deliveried_numbers}></a></strong></td>
            <td><strong><a key='my_deliveried_numbers' href="javascript:void(0);"><{$item.my_deliveried_numbers}></a></strong></td>
            <td class='date'><strong><{$item.createdate|date:'Y-m-d'}></strong></td>
          </tr>
         <{/foreach}>
        </tbody>
      </table>
      </form>
      <div class="gridlist-footer" style="width:760px; text-align:right;">需发货：<{$count.delivery_numbers}> &nbsp;&nbsp;&nbsp;已发货共计：<{$count.deliveried_numbers}> &nbsp;&nbsp;&nbsp;我的发货数量：<{$count.count_my_deliveried_numbers}></div>
  </div>

<script>
(function(){
 $$("#dNode a").each(function(item,i){
    var parent=item.getParent("tr");
    var id=parent.get("id");
    var name=item.get("key");
    var date=parent.getElement("td.date").get('text');

    if(name=='delivery_numbers'){
        item.addEvent('click',function(e){
            var url='index.php?app=desktop&act=alertpages&goto='+encodeURIComponent('index.php?app=omekpi&ctl=admin_deliverier&act=getDelivery');
            new finderDialog(url,{width:1000,height:660});
        });
    }
    if(name=='deliveried_numbers'){
        item.addEvent('click',function(e){
        
            var url='index.php?app=desktop&act=alertpages&goto='+encodeURIComponent('index.php?app=omekpi&ctl=admin_deliverier&act=getDeliveried');
            new finderDialog(url,{width:1000,height:660});
        });
    }
    
    if(name=='my_deliveried_numbers'){
        item.addEvent('click',function(e){
            var url='index.php?app=desktop&act=alertpages&goto='+encodeURIComponent('index.php?app=omekpi&ctl=admin_deliverier&act=getMydeliveried&id='+id+'&date='+date);
            new finderDialog(url,{width:1000,height:660});
        });
    }
 });
    
})();



</script>
